var treeData = [
  {
    ID: "沈进",
    NAME: '应急指挥官',
    children: [
      {
        ID: '张霖',
        NAME: '联络员',
        children: [
          {
            ID: '梅秋',
            NAME: '联络员',
          },

        ],
      },
      {
        ID: '李金凤',
        NAME: '联络员',
      },
      {
        ID: '冯都',
        NAME: '联络员',
        children: [
          {
            ID: "赵明明",
            NAME: '联络员',
          },
          {
            ID: '张俊峰',
            NAME: '联络员',
            children: [
              {
                ID: '李峰',
                NAME: '联络员',
              },
              {
                ID: '孙超',
                NAME: '联络员',
              },
              {
                ID: '赵丰进',
                NAME: '联络员',
              },

            ],
          },

        ],
      },

    ],
  },
]
const option = {
  series: [
    {
      type: 'tree',
      edgeShape: 'polyline', // 链接线是折现还是曲线
      orient: 'TB',
      roam: true,
      data: treeData,
      width: '85%',
      height: '75%',
      left: '5%',
      right: '5%',
      top: '12%',
      bottom: '1%',
      symbolSize: 2,
      initialTreeDepth: 10,
      label: {
        normal: {
          position: 0,
          align: 'center',
          padding: [10, 20],
          fontWeight: 'bold',
          formatter: function (param) {
            let NAME =
              param.data.NAME.substring(0, 8) +
              '\n' +
              param.data.NAME.substring(8, 16) +
              '\n' +
              param.data.NAME.substring(16);
            return [`{img|}`, `{VALUE|${param.data.ID}}`, `{NAME|${NAME}}`].join('\n');
          },
          rich: {
            img: {
              backgroundColor: {
                image: ''
              },
              width: 93,
              height: 78,
            },
            VALUE: {
              color: '#4cE4E6',
              fontSize: 18,
              fontFamily: 'DIN',
              verticalAlign: 'top',
              position: 'top',
              width: 93,
              padding: [5, 0],
            },
            NAME: {
              color: '#fff',
              fontSize: 14,
              verticalAlign: 'top',
              width: 93,
              padding: [5, 0],
            },
          },
        },
      },
      lineStyle: {
        color: '#158387',
      },
      expandAndCollapse: true,
      animationDuration: 550,
      animationDurationUpdate: 750,
    },
  ],
};


export default option
